package com.zp.imagecompresspractice.View;

import android.view.View;

/**
 * Created by izp on 2017/6/7.
 */

public class ViewWrapper {
    private View mTarget;

    public ViewWrapper(View mTarget) {
        this.mTarget = mTarget;
    }
    public int getWidth(){
        return  mTarget.getLayoutParams().width;
    }
    public void setWidth(int width){
        mTarget.getLayoutParams().width = width;
        mTarget.requestLayout();//这里的requestLayout我不是很明白，再有，是否需要调用mTarget.invalidate();
//        mTarget.invalidate();
    }

    public int getHeight(){
        return mTarget.getLayoutParams().height;
    }
    public void setHeight(int height){
        mTarget.getLayoutParams().height = height;
        mTarget.requestLayout();
    }

}
